<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="UTF-8" />
    <title>Back Button</title>
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
    />
    <link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
    <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
    <script src="../../../../../scripts/testing/scripts.js"></script>
    <script nomodule src="../../../../../dist/ionic/ionic.js"></script>
    <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
    <script>
      class PageOne extends HTMLElement {
        connectedCallback() {
          this.innerHTML = `

            <ion-header>
              <ion-toolbar>
                <ion-buttons slot="start">
                  <ion-back-button></ion-back-button>
                </ion-buttons>
                <ion-title>Page One</ion-title>
              </ion-toolbar>
            </ion-header>
            <ion-content class="ion-padding">
              <h1>Page One</h1>
              <ion-nav-link router-direction="forward" component="page-two">
                <button>Go to Page Two</button>
              </ion-nav-link>
            </ion-content>
        `;
        }
      }

      class PageTwo extends HTMLElement {
        connectedCallback() {
          this.innerHTML = `

            <ion-header>
              <ion-toolbar>
                <ion-buttons slot="start">
                  <ion-back-button></ion-back-button>
                </ion-buttons>
                <ion-title>Page Two</ion-title>
              </ion-toolbar>
            </ion-header>
            <ion-content class="ion-padding">
              <h1>Page Two</h1>
              <div>
                <ion-nav-link router-direction="forward" component="page-three">
                  <button>Go to Page Three</button>
                </ion-nav-link>
              </div>
            </ion-content>
        `;
        }
      }

      class PageThree extends HTMLElement {
        connectedCallback() {
          this.innerHTML = `

            <ion-header>
              <ion-toolbar>
                <ion-buttons slot="start">
                  <ion-back-button text='Page Two'></ion-back-button>
                </ion-buttons>
                <ion-title>Page Three</ion-title>
              </ion-toolbar>
            </ion-header>
            <ion-content class="ion-padding">
              <h1>Page Three</h1>
              <div>
                <ion-nav-link router-direction="forward" component="page-four">
                  <button>Go to Page Four</button>
                </ion-nav-link>
              </div>
            </ion-content>
        `;
        }
      }

      class PageFour extends HTMLElement {
        connectedCallback() {
          this.innerHTML = `

            <ion-header>
              <ion-toolbar>
                <ion-buttons slot="start">
                  <ion-back-button text='Page Three'></ion-back-button>
                </ion-buttons>
                <ion-title>Page Four</ion-title>
              </ion-toolbar>
            </ion-header>
            <ion-content class="ion-padding">
              <h1>Page Four</h1>
            </ion-content>
        `;
        }
      }

      customElements.define('page-one', PageOne);
      customElements.define('page-two', PageTwo);
      customElements.define('page-three', PageThree);
      customElements.define('page-four', PageFour);
    </script>
  </head>

  <body>
    <ion-app>
      <ion-nav root="page-one"></ion-nav>
    </ion-app>
  </body>
</html>
